package com.le123.ysdq.sopacker

class Rule {
    final String name
    List<String> excludeList = []
    List<String> includeList = []

    Map<String, List<String>> excludeMap = new HashMap<>();

    Rule(String name) {
        this.name = name
    }

    void exclude(String... args) {
        excludeList += Arrays.asList(args)
    }

    void include(String... args) {
        includeList += Arrays.asList(args)
    }

    void excludePacker(String key, String value) {
        def list
        if (excludeMap.containsKey(key)) {
            list = excludeMap.get(key)
            if (list == null) list = []
        } else {
            list = []
        }
        list.add(value)
        excludeMap.put(key, list)
    }

}